import request from '@/router/axios';
// 责任部门列表
export const ResponsibleDepartmentList = (query) => {
  return request({
    url: '/api/xmbz-work/work/getResponsibleDepartmentList',
    method: 'get',
    params: query
  })
}
// 蛋糕去向列表
export const CakeWhereaboutsList = (query) => {
  return request({
    url: '/api/xmbz-work/work/getCakeWhereaboutsList',
    method: 'get',
    params: query
  })
}
export const ReminderTypeList = (query) => { //催单类型
  return request({
    url: '/api/xmbz-work/work/getReminderTypeList',
    method: 'get',
    params: query
  })
}
export const WorkOrderList = (query) => { // 催单分页条件查询
  return request({
    url: '/api/xmbz-work/work/getWorkOrderReminderPage',
    method: 'get',
    params: query
  })
}
// 备款start---------------------------------------------------------------------------------------------------------------
export const ProvisionsOperationList = (query) => { //备款状态
  return request({
    url: '/api/xmbz-work/work/getProvisionsOperationList',
    method: 'get',
    params: query
  })
}

// 备款分页条件查询
export const ReserveOrderList = (query) => {
  return request({
    url: '/api/xmbz-work/work/getWorkOrderProvisionsPage',
    method: 'get',
    params: query
  })
}

// 备款end---------------------------------------------------------------------------------------------------------------
// 退订工单分页start---------------------------------------------------------------------------------------------------------------
export const UnsubscribePage = (query) => { // 退订工单分页条件查询
  return request({
    url: '/api/xmbz-work/work/getWorkOrderUnsubscribePage',
    method: 'get',
    params: query
  })
}
// 退订工单分页end---------------------------------------------------------------------------------------------------------------
//退款start------------------------------------------------------------------------------------------------------------------------
export const CompensationMethod = (query) => { //赔偿方式列表
  return request({
    url: '/api/xmbz-work/work/getCompensationMethodList',
    method: 'get',
    params: query
  })
}
export const FullRefundList = (query) => { // 全额退款
  return request({
    url: '/api/xmbz-work/work/getFullRefundList',
    method: 'get',
    params: query
  })
}
export const RefundGradeList = (query) => { //退款等级列表
  return request({
    url: '/api/xmbz-work/work/getRefundGradeList',
    method: 'get',
    params: query
  })
}
export const RefundReasonList = (query) => { //退款原因列表
  return request({
    url: '/api/xmbz-work/work/getRefundReasonList',
    method: 'get',
    params: query
  })
}
export const RefundTypeList = (query) => { //退款类型列表
  return request({
    url: '/api/xmbz-work/work/getRefundTypeList',
    method: 'get',
    params: query
  })
}
export const AddRefund = (data) => { //新增退款
  return request({
     // url: 'http://192.168.2.106:8112/work/insertWorkOrderRefund',
    url: '/api/xmbz-work/work/insertWorkOrderRefund',
    method: 'post',
    data
  })
}
export const IsProductionList = (query) => { //退款类型列表
  return request({
    url: '/api/xmbz-work/work/getIsProductionList', //是否生产列表
    method: 'get',
    params: query
  })
}
export const WorkOrderRefundPage = (query) => { //退款工单分页条件查询
  return request({
    // url: 'http://192.168.2.106:8112/work/getWorkOrderRefundPage',
    url: '/api/xmbz-work/work/getWorkOrderRefundPage',
    method: 'get',
    params: query
  })
}
export const ApprovalPass = (query) => { //退款审核通过
  return request({
    url: '/api/xmbz-work/work/approvalPass', //是否生产列表
    method: 'POST',
    params: query
  })
}
export const ApprovalNotPass = (query) => { //退款审核不通过
  return request({
    url: '/api/xmbz-work/work/approvalNotPass', //
    method: 'POST',
    params: query
  })
}

export const updateWorkOrderRefund = (query) => { //退款编辑
  return request({
    url: '/api/xmbz-work/work/updateWorkOrderRefund',
    method: 'post',
    params: query
  })
}

export const signWorkOrderRefund = (query) => { //标记退款
  return request({
    url: '/api/xmbz-work/work/signWorkOrderRefund',
    method: 'post',
    params: query
  })
}
export const getOrderChannelList = (query) => { //渠道
  return request({
    url: '/api/xmbz-work/work/getOrderChannelList',
    method: 'GET',
    params: query
  })
}
export const getWhetherRefundList = (query) => { //退款状态列表
  return request({
    url: '/api/xmbz-work/work/getWhetherRefundList',
    method: 'GET',
    params: query
  })
}
export const getFinancialRejection = (query) => { //财务驳回
  return request({
    url: '/api/xmbz-work/work/getFinancialRejection',
    method: 'post',
    params: query
  })
}
export const getApprovalList = (query) => { //审核状态列表
  return request({
    url: '/api/xmbz-work/work/getApprovalList',
    method: 'get',
    params: query
  })
}
// 申请审核
export const getApplyRefund = (query) => { //审核状态列表
  return request({
    url: '/api/xmbz-work/work/getApplyRefund',
    method: 'post',
    params: query
  })
}
//退款end--------------------------------------------------------------------------------
//备款---------------------------------------------------------------------------------------------
export const updateWorkOrder = (query) => { //备款编辑
  return request({
    url: '/api/xmbz-work/work/updateWorkOrderProvisions',
    method: 'POST',
    params: query
  })
}

export const OrderOperateLog = (query) => { //工单日志
  return request({
    url: '/api/xmbz-work/work/getOrderOperateLog',
    method: 'get',
    params: query
  })
}

export const listAuditLog = (query) => { //工单日志
  return request({
    url: '/api/xmbz-work/workTimeoutAppeal/listAuditLog',
    method: 'get',
    params: query
  })
}

// 投诉 start------------------------------------------------------
export const DepartmentList = (query) => { //投诉责任部门列表
  return request({
    url: '/api/xmbz-work/work/getComplaintResponsibleDepartmentList',
    method: 'GET',
    params: query
  })
}
export const DepartmentErrorTypeList = (query) => { //部门失误类型列表
  return request({
    url: '/api/xmbz-work/work/getDepartmentErrorTypeList',
    method: 'GET',
    params: query
  })
}
export const getComplaintLevelList = (query) => { //投诉等级列表
  return request({
    url: '/api/xmbz-work/work/getComplaintLevelList',
    method: 'GET',
    params: query
  })
}
export const getComplaintChannelList = (query) => { //投诉渠道列表
  return request({
    url: '/api/xmbz-work/work/getComplaintChannelList',
    method: 'GET',
    params: query
  })
}
export const addWorkOrderComplaint = (data) => { //新增投诉
  return request({
    url: '/api/xmbz-work/work/addWorkOrderComplaint',
    header: 'application/json;charset=utf-8',
    method: 'post',
    data
  })
}

export const addWorkOrderProblem = (data) => {   // 新增问题工单
  return request ({
    url: '/api/xmbz-work/work/createWorkOrderProblem',
    method: 'post',
    header: 'application/json;charset=utf-8',
    data
  })
}

export const OrderComplaintPage = (data) => { //投诉工单分页条件查询
  return request({
    // url: '/api/xmbz-work/work/getWorkOrderComplaintPage',
    url: '/api/xmbz-work/work/getWorkOrderComplaintPage',
    method: 'POST',
    data
  })
}
export const updateWorkOrderComplaint = (data) => { //投诉编辑
  return request({
    url: '/api/xmbz-work/work/updateWorkOrderComplaint',
    method: 'post',
    header: 'application/json;charset=utf-8',
    data
  })
}
export const getHandleStateList = (query) => { //处理状态列表
  return request({
    url: '/api/xmbz-work/work/getHandleStateList',
    method: 'GET',
    params: query
  })
}
export const getlaunchRefund = (query) => { //投诉工单发起退款
  return request({
    url: '/api/xmbz-work/work/launchRefund',
    // url:'http://192.168.2.11:8112/work/launchRefund',
    method: 'post',
    params: query
  })
}
export const transferWorkOrderProblem = (query) => { //投诉工单转问题工单
  return request({
    url: '/api/xmbz-work/work/transferWorkOrderProblem',
    method: 'post',
    params: query
  })
}
//

// 投诉end------------------------------------------------------

// 问题查询

export const getWorkOrderProblemPage = (data) => { //问题查询
  return request({
    url: '/api/xmbz-work/work/getWorkOrderProblemPage',
    method: 'post',
    data
  })
}

export const updateWorkOrderProblem = (data) => { //问题编辑
  return request({
    url: '/api/xmbz-work/work/updateWorkOrderProblem',
    method: 'post',
    header: 'application/json;charset=utf-8',
    data
  })
}

// 异常工单

export const getWorkOrderAbnormalPage = (data) => { //异常渠道列表
  return request({
    url: '/api/xmbz-work/work/getWorkOrderAbnormalPage',
    // url: 'http://192.168.2.106:8112/work/getWorkOrderAbnormalPage',
    method: 'post',
    data
  })
}
export const AbnormalChannelList = (query) => { //异常渠道列表
  return request({
    url: '/api/xmbz-work/work/getAbnormalChannelList',
    // url: 'http://192.168.2.106:8112/work/getAbnormalChannelList',
    method: 'get',
    params: query
  })
}
export const updateWorkOrderAbnormal = (data) => { //编辑异常工单
  return request({
    url: '/api/xmbz-work/work/updateWorkOrderAbnormal',
    // url: 'http://192.168.2.106:8112/work/getAbnormalChannelList',
    method: 'post',
    header: 'application/json;charset=utf-8',
    data
  })
}
export const getWorkOrderQueryList = (query) => { //编辑异常工单
  return request({
    url: '/api/xmbz-work/work/getWorkOrderQueryList',
    // url: 'http://192.168.2.106:8112/work/getAbnormalChannelList',
    method: 'get',
    params: query
  })
}

export const workOrderAbnormalLaunchRefund = (query) => { //异常工单退款
  return request({
    url: '/api/xmbz-work/work/workOrderAbnormalLaunchRefund',
    // url: 'http://192.168.2.106:8112/work/getAbnormalChannelList',
    method: 'post',
    params: query
  })
}
export const getWorkOrderLossPage = (query) => { // 报损列表
  return request({
    url: '/api/xmbz-work/work/getWorkOrderLossPage',
      // url: 'http://192.168.2.11:8112/work/getWorkOrderLossPage',
    method: 'get',
    params: query
  })
}

export const getRefundModeList = (query) => { // 退款方式(取dictKey)
  return request({
    url: '/api/xmbz-work/work/getRefundModeList',
    method: 'get',
    params: query
  })
}

export const getKingdeeSynchronizationFailPage = (query) => { //同步金蝶列表
  return request({
    url: '/api/xmbz-work/work/getKingdeeSynchronizationFailPage',
    // url: 'http://192.168.2.106:8112/work/getKingdeeSynchronizationFailPage',
    method: 'get',
    params: query
  })
}
export const kingdeefailtype = (query) => { // 退款方式(取dictKey)
  return request({
    url: '/api/xmbz-system/dict/dictionary?code=kingdee_fail_type',
    // url: 'http://192.168.2.106:8112/work/getKingdeeSynchronizationFailPage',
    method: 'get',
    params: query
  })
}

export const synchronizationKingdeeFailOrder = (data) => { // 同步金蝶订单
  return request({
    url: '/api/xmbz-work/work/synchronizationKingdeeFailOrder',
    // url: 'http://192.168.2.106:8112//work/synchronizationKingdeeFailOrder',
    method: 'post',
   data
  })
}
// 好评返现分页条件查询列表
export const getOrdersPraiseQueryPageList = (query) => { // 退款方式(取dictKey)
  return request({
    url: '/api/xmbz-order/OrdersPraise/getOrdersPraiseQueryPageList',
    // url: 'http://192.168.2.106:8112/work/getKingdeeSynchronizationFailPage',
    method: 'get',
    params: query
  })
}
//

export const praisesendstate = (query) => { //红包发放状态
  return request({
    url: '/api/xmbz-system/dict/dictionary?code=order_praise_send_state',
    method: 'get',
    params: query
  })
}
export const orderpraisestatus = (query) => { //好评返现审核状态
  return request({
    url: '/api/xmbz-system/dict/dictionary?code=order_praise_status',
    method: 'get',
    params: query
  })
}

// 渠道类别列表
export const OrderChannelTypeList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderChannelTypeList',
    // url: 'http://192.168.2.106:8107/order/getOrderChannelTypeList',
    method: 'get',
    params: query
  })
}
export const getOrderChannelLists = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderChannelList',
    // url: 'http://192.168.2.106:8107/order/getOrderChannelTypeList',
    method: 'get',
    params: query
  })
}

export function deptdepts() { //城市
  return request({
    url: '/api/xmbz-system/dept/depts',
    method: 'get',
  })
}

export const applyOrdersPraise = (data) => {
  return request({
    url: '/api/xmbz-order/OrdersPraise/applyOrdersPraise',
    method: 'post',
    data
  })
}

// 详情接口
export const getGoodsByxmbzNo = (query) => {
  return request({
    url: '/api/xmbz-work/work/getGoodsByxmbzNo',
    method: 'get',
    params: query
  })
}

export const detailList = (query) => {
  return request({
    url: '/api/xmbz-work/work/getGoodsByOrderId',
    method: 'get',
    params: query
  })
}

// 新增退款
export const addWorkOrderRefund = (data) => {
  return request({
    url: '/api/xmbz-work/work/addWorkOrderRefund',
    // url: 'http://192.168.2.106:8112/work/addWorkOrderRefund',
    method: 'post',
    data
  })
}

// 平台退款中
export const deleteOrderExt = (data) => {
  return request({
    url: '/api/xmbz-order/order/deleteOrderExt',
    // url: 'http://192.168.0.191:8107/order/deleteOrderExt',
    method: 'post',
    data
  })
}

export const addRefundNotReturn = (data) => {
  return request({
    url: '/api/xmbz-work/work/addRefundNotReturn',
    // url: 'http://192.168.2.106:8112/work/addWorkOrderRefund',
    method: 'post',
    data
  })
}
//查询发票记录
export const orderInvoiceQueryPage = (query) => {
  return request({
    url: '/api/xmbz-order/orderInvoice/queryPage',
    method: 'get',
    params: query
  })
}
//发票审批
export const orderInvoiceApprove = (query) => {
  return request({
    url: '/api/xmbz-order/orderInvoice/approve',
    method: 'get',
    params: query
  })
}
//发票一键审批
export const orderInvoiceApproveBatch = data => {
    return request({
      url: '/api/xmbz-order/orderInvoice/approveBatch',
      method: 'post',
      data
    })
  }
//发票审核状态
export const orderInvoiceStatus = (query) => {
  return request({
    url: '/api/xmbz-system/dict/dictionary?code=order_invoice_status',
    method: 'get',
    params: query
  })
}

export const relationtype = (query) => {
  return request({
    url: '/api/xmbz-system/dict/dictionary',
    method: 'get',
    params: query
  })
}

export const workComplaint = (data) =>{
  return request({
    url: '/api/xmbz-work/workComplaintAppeal/listPage',
    method:'post',
    data
  })
}

export const workComplaintAudit = (data) =>{
  return request({
    url: '/api/xmbz-work/workComplaintAppeal/audit',
    method:'post',
    data
  })
}

// 获取超时投诉工单列表分页
export const workTimeoutListPage = (data) =>{
  return request({
    url:'/api/xmbz-work/workTimeoutAppeal/listPage',
    method: 'post',
    data
  })
}

export const workTimeoutlaintAudit = (data) =>{
  return request({
    url: '/api/xmbz-work/workTimeoutAppeal/audit',
    method:'post',
    data
  })
}

export const workTimeoutlaintAuditEnd = (data) =>{
  return request({
    url: '/api/xmbz-work/workTimeoutAppeal/auditEnd',
    method:'post',
    data
  })
}

export const workComplaintAppealEnd = (data) =>{
  return request({
    url: '/api/xmbz-work/workComplaintAppeal/auditEndComplaint',
    method:'post',
    data
  })
}

export const getResponsibleDepartmentErrorTree = () =>{
  return request({
    url: '/api/xmbz-work/work/getResponsibleDepartmentErrorTree',
    method: 'get',
  })
}

// 异常工单转异常配送
export const returnAbnormal= (data) =>{
  return request({
    url: '/api/xmbz-work/work/returnAbnormal',
    method:'post',
    data
  })
}

// 客服转接
export const staffForward = (data) =>{
  return request({
    url: '/api/xmbz-work/work/staffForward',
    method:'post',
    data
  })
}

// 一键退款
export const batchSignWorkOrderRefund = (data) =>{
  return request({
    url: '/api/xmbz-work/work/batchSignWorkOrderRefund',
    method:'post',
    data
  })
}

// 工单异常驳回
export const workOrderReject = (params) =>{
  return request({
    url: '/api/xmbz-work/work/reject',
    method:'post',
    params
  })
}

// 驳回的退款工单
export const getNotReadCustomServiceLog = (params) =>{
  return request({
    url: '/api/xmbz-work/customerservicelog/getNotReadCustomServiceLog',
    method:'GET',
    params
  })
}

// 客服处理通知日志
export const customServiceChoice = (data) =>{
  return request({
    url: '/api/xmbz-work/customerservicelog/customServiceChoice',
    method:'POST',
    data
  })
}

// 生产申诉列表
export const listProductionAppeals = (params) =>{
  return request({
    url: '/api/xmbz-work/productionAppeal/listProductionAppeals',
    method:'get',
    params
  })
}

// 生产申诉提交
export const submitComplaints = (data) =>{
  return request({
    url: '/api/xmbz-work/productionAppeal/submitComplaints',
    method:'POST',
    data
  })
}

// 生产申诉审核
export const updateComplaints = (data) =>{
  return request({
    url: '/api/xmbz-work/productionAppeal/updateComplaints',
    method:'POST',
    data
  })
}

// 催单
export const workReminder = (data) =>{
  return request({
    url: '/api/xmbz-work/work/workReminder',
    method:'POST',
    data
  })
}

// 申请改款工单
export const updateWorkGoodsSku = (data) =>{
  return request({
    url: '/api/xmbz-work/WorkGoodsSkuModify/updateWorkGoodsSku',
    method:'POST',
    data
  })
}

// 改款工单查询
export const workGoodsSkuModifyList = (params) =>{
  return request({
    url: '/api/xmbz-work/WorkGoodsSkuModify/list',
    method:'get',
    params
  })
}


// 异常提醒待处理数量
export const listAbnormalCount = (params) =>{
  return request({
    url: '/api/xmbz-work/WorkGoodsSkuModify/listAbnormalCount',
    method:'get',
    params
  })
}

// 
export const WorkGoodsSkuModifyDisposeRemind = (data) =>{
  return request({
    url: '/api/xmbz-work/WorkGoodsSkuModify/disposeRemind',
    method:'POST',
    data
  })
}

// 投诉工单删除
export const deleteWorkOrderComplaint = (data) =>{
  return request({
    url: '/api/xmbz-work/work/deleteWorkOrderComplaint',
    method:'POST',
    data
  })
}
